package com.bwie.config;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName consult
 */
@Data
@Document(indexName = "day0902mo", shards = 1, replicas = 1)
public class ConsultInfo implements Serializable {
    /**
     *
     */
    @Id
    private Integer id;

    /**
     * 姓名
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;

    /**
     * 手机号
     */
    @Field(type = FieldType.Keyword)
    private String phone;

    /**
     * 身份证号
     */
    @Field(type = FieldType.Keyword)
    private String card;

    /**
     * 拜访时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;

    /**
     * 拜访事由
     */
    @Field(type = FieldType.Keyword)
    private Integer contentId;

    /**
     * 拜访部门
     */
    @Field(type = FieldType.Integer)
    private Integer typeId;

    /**
     * 拜访人
     */
    @Field(type = FieldType.Integer)
    private Integer visitorId;


    @TableField(exist = false)
    private String contentName;


    //状态
    @Field(type = FieldType.Integer)
    private Integer status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}